home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Prog / M / MacStarter.sit / other applicationProcs files / scrollDemo.c < prev    next >
MacBinary  |  1992-10-11  |  10.3 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: scrollDemo.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Oct 11 15:26:48 1992, modified Sun Oct 11 15:26:48 1992, creator Think C, type ASCII, 9403 bytes "scrollDemo.c" , at 0x253b 798 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 73 63 72 6f 6c 6c | 44 65 6d 6f 2e 63 00 00 |..scroll|Demo.c..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 24 bb 00 | 00 03 1e a6 fe 30 78 a6 |.....$..|.....0x.|
|00000060| fe 30 78 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.0x.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 72 02 00 00 |........|....r...|
|00000080| 2f 2a 20 54 68 69 73 20 | 66 69 6c 65 20 64 65 6d |/* This |file dem|
|00000090| 6f 6e 73 74 72 61 74 65 | 73 20 73 69 6d 70 6c 65 |onstrate|s simple|
|000000a0| 20 75 73 65 20 6f 66 20 | 73 63 72 6f 6c 6c 20 62 | use of |scroll b|
|000000b0| 61 72 73 20 69 6e 20 4d | 61 63 53 74 61 72 74 65 |ars in M|acStarte|
|000000c0| 72 2e 0d 20 20 20 4a 75 | 73 74 20 66 6f 72 20 66 |r.. Ju|st for f|
|000000d0| 75 6e 2c 20 69 74 20 61 | 6c 73 6f 20 69 6c 6c 75 |un, it a|lso illu|
|000000e0| 73 74 72 61 74 65 73 20 | 68 6f 77 20 74 6f 20 63 |strates |how to c|
|000000f0| 68 61 6e 67 65 20 74 68 | 65 20 63 75 72 73 6f 72 |hange th|e cursor|
|00000100| 20 73 74 79 6c 65 2e 0d | 20 20 20 54 6f 20 75 73 | style..| To us|
|00000110| 65 20 74 68 69 73 20 66 | 69 6c 65 2c 20 79 6f 75 |e this f|ile, you|
|00000120| 20 73 68 6f 75 6c 64 20 | 61 64 64 20 69 74 20 74 | should |add it t|
|00000130| 6f 20 74 68 65 20 4d 61 | 63 53 74 61 72 74 65 72 |o the Ma|cStarter|
|00000140| 2e b9 20 70 72 6f 6a 65 | 63 74 0d 20 20 20 61 6e |.. proje|ct. an|
|00000150| 64 20 64 65 6c 65 74 65 | 20 74 68 65 20 63 75 72 |d delete| the cur|
|00000160| 72 65 6e 74 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |rent app|lication|
|00000170| 50 72 6f 63 73 20 66 69 | 6c 65 2e 0d 20 20 20 20 |Procs fi|le.. |
|00000180| 20 20 20 41 6c 6c 20 70 | 6c 61 63 65 73 20 77 68 | All p|laces wh|
|00000190| 65 72 65 20 74 68 69 73 | 20 66 69 6c 65 20 68 61 |ere this| file ha|
|000001a0| 73 20 62 65 65 6e 20 6d | 6f 64 69 66 69 65 64 20 |s been m|odified |
|000001b0| 28 66 72 6f 6d 20 74 68 | 65 20 0d 20 20 20 6f 72 |(from th|e . or|
|000001c0| 69 67 69 6e 61 6c 20 61 | 70 70 6c 69 63 61 74 69 |iginal a|pplicati|
|000001d0| 6f 6e 50 72 6f 63 73 2e | 63 29 20 61 72 65 20 63 |onProcs.|c) are c|
|000001e0| 6f 6d 6d 65 6e 74 65 64 | 20 77 69 74 68 20 63 6f |ommented| with co|
|000001f0| 6d 6d 65 6e 74 73 0d 20 | 20 20 74 68 61 74 20 62 |mments. | that b|
|00000200| 65 67 69 6e 20 77 69 74 | 68 20 2f 2f 0d 2a 2f 0d |egin wit|h //.*/.|
|00000210| 0d 23 69 6e 63 6c 75 64 | 65 20 22 67 6c 6f 62 61 |.#includ|e "globa|
|00000220| 6c 73 2d 4d 61 63 53 74 | 61 72 74 65 72 2e 68 22 |ls-MacSt|arter.h"|
|00000230| 0d 0d 6c 6f 6e 67 20 67 | 45 76 65 6e 74 57 61 69 |..long g|EventWai|
|00000240| 74 54 69 6d 65 20 3d 20 | 33 3b 20 20 20 2f 2f 20 |tTime = |3; // |
|00000250| 61 20 76 61 6c 75 65 20 | 6f 66 20 33 20 69 6e 64 |a value |of 3 ind|
|00000260| 69 63 61 74 65 73 20 74 | 68 61 74 20 74 68 69 73 |icates t|hat this|
|00000270| 20 70 72 6f 67 72 61 6d | 20 0d 20 20 20 20 20 20 | program| . |
|00000280| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000290| 20 20 20 20 20 2f 2f 20 | 77 61 6e 74 73 20 66 75 | // |wants fu|
|000002a0| 6e 63 74 69 6f 6e 20 41 | 70 70 6c 69 63 61 74 69 |nction A|pplicati|
|000002b0| 6f 6e 49 64 6c 65 20 74 | 6f 20 62 65 20 63 61 6c |onIdle t|o be cal|
|000002c0| 6c 65 64 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |led. | |
|000002d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|000002e0| 2f 20 65 76 65 72 79 20 | 33 2f 36 30 2d 74 68 20 |/ every |3/60-th |
|000002f0| 73 65 63 6f 6e 64 73 20 | 28 69 66 20 70 6f 73 73 |seconds |(if poss|
|00000300| 69 62 6c 65 29 2e 20 20 | 54 68 69 73 20 0d 20 20 |ible). |This . |
|00000310| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000320| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 73 65 65 6d | | // seem|
|00000330| 73 20 74 6f 20 62 65 20 | 61 20 72 65 61 73 6f 6e |s to be |a reason|
|00000340| 61 62 6c 65 20 69 6e 74 | 65 72 76 61 6c 20 77 68 |able int|erval wh|
|00000350| 65 6e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |en. | |
|00000360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f | | //|
|00000370| 20 41 70 70 6c 69 63 61 | 74 69 6f 6e 49 64 6c 65 | Applica|tionIdle|
|00000380| 20 69 73 20 73 65 74 74 | 69 6e 67 20 74 68 65 20 | is sett|ing the |
|00000390| 63 75 72 73 6f 72 20 73 | 74 79 6c 65 2e 0d 20 20 |cursor s|tyle.. |
|000003a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003b0| 20 20 20 20 20 20 20 20 | 20 0d 43 75 72 73 48 61 | | .CursHa|
|000003c0| 6e 64 6c 65 20 66 69 6e | 67 65 72 43 75 72 73 6f |ndle fin|gerCurso|
|000003d0| 72 3b 20 2f 2f 20 67 6c | 6f 62 61 6c 20 76 61 72 |r; // gl|obal var|
|000003e0| 69 61 62 6c 65 20 66 6f | 72 20 61 20 63 75 72 73 |iable fo|r a curs|
|000003f0| 6f 72 20 74 68 61 74 20 | 6c 6f 6f 6b 73 0d 20 20 |or that |looks. |
|00000400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000410| 20 20 20 20 20 20 20 2f | 2f 20 6c 69 6b 65 20 61 | /|/ like a|
|00000420| 20 70 6f 69 6e 74 69 6e | 67 20 68 61 6e 64 2e 20 | pointin|g hand. |
|00000430| 20 54 68 69 73 20 63 75 | 72 73 6f 72 20 69 73 20 | This cu|rsor is |
|00000440| 6c 6f 61 64 65 64 0d 20 | 20 20 20 20 20 20 20 20 |loaded. | |
|00000450| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000460| 2f 2f 20 69 6e 20 49 6e | 69 74 41 70 70 6c 69 63 |// in In|itApplic|
|00000470| 61 74 69 6f 6e 20 20 20 | 20 20 20 20 20 20 20 20 |ation | |
|00000480| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 0d | | .|
|00000490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004a0| 20 20 20 20 20 20 20 20 | 20 0d 0d 4d 65 6e 75 48 | | ..MenuH|
|000004b0| 61 6e 64 6c 65 20 65 64 | 69 74 4d 65 6e 75 2c 20 |andle ed|itMenu, |
|000004c0| 66 69 6c 65 4d 65 6e 75 | 3b 0d 0d 76 6f 69 64 20 |fileMenu|;..void |
|000004d0| 49 6e 69 74 41 70 70 6c | 69 63 61 74 69 6f 6e 28 |InitAppl|ication(|
|000004e0| 76 6f 69 64 29 3b 0d 76 | 6f 69 64 20 55 70 64 61 |void);.v|oid Upda|
|000004f0| 74 65 4d 65 6e 75 73 28 | 76 6f 69 64 29 3b 0d 76 |teMenus(|void);.v|
|00000500| 6f 69 64 20 44 6f 45 64 | 69 74 4d 65 6e 75 28 69 |oid DoEd|itMenu(i|
|00000510| 6e 74 20 69 74 65 6d 4e | 75 6d 29 3b 0d 76 6f 69 |nt itemN|um);.voi|
|00000520| 64 20 44 6f 46 69 6c 65 | 4d 65 6e 75 28 69 6e 74 |d DoFile|Menu(int|
|00000530| 20 69 74 65 6d 4e 75 6d | 2c 20 69 6e 74 2a 20 64 | itemNum|, int* d|
|00000540| 6f 6e 65 29 3b 0d 76 6f | 69 64 20 44 6f 4f 74 68 |one);.vo|id DoOth|
|00000550| 65 72 4d 65 6e 75 28 69 | 6e 74 20 6d 65 6e 75 49 |erMenu(i|nt menuI|
|00000560| 44 2c 20 69 6e 74 20 69 | 74 65 6d 4e 75 6d 29 3b |D, int i|temNum);|
|00000570| 0d 76 6f 69 64 20 41 70 | 70 6c 69 63 61 74 69 6f |.void Ap|plicatio|
|00000580| 6e 49 64 6c 65 28 76 6f | 69 64 29 3b 0d 76 6f 69 |nIdle(vo|id);.voi|
|00000590| 64 20 43 6c 65 61 6e 55 | 70 41 70 70 6c 69 63 61 |d CleanU|pApplica|
|000005a0| 74 69 6f 6e 28 76 6f 69 | 64 29 3b 0d 76 6f 69 64 |tion(voi|d);.void|
|000005b0| 20 41 62 6f 75 74 42 6f | 78 28 76 6f 69 64 29 3b | AboutBo|x(void);|
|000005c0| 0d 76 6f 69 64 20 44 6f | 4e 65 77 43 6f 6d 6d 61 |.void Do|NewComma|
|000005d0| 6e 64 28 76 6f 69 64 29 | 3b 0d 0d 0d 63 6c 61 73 |nd(void)|;...clas|
|000005e0| 73 20 6d 79 57 69 6e 64 | 6f 77 20 3a 20 70 75 62 |s myWind|ow : pub|
|000005f0| 6c 69 63 20 78 57 69 6e | 64 6f 77 20 7b 0d 20 20 |lic xWin|dow {. |
|00000600| 70 75 62 6c 69 63 3a 0d | 20 20 20 76 69 72 74 75 |public:.| virtu|
|00000610| 61 6c 20 76 6f 69 64 20 | 4f 70 65 6e 49 6e 52 65 |al void |OpenInRe|
|00000620| 63 74 28 53 74 72 32 35 | 35 20 74 69 74 6c 65 2c |ct(Str25|5 title,|
|00000630| 20 69 6e 74 20 6c 65 66 | 74 2c 20 69 6e 74 20 74 | int lef|t, int t|
|00000640| 6f 70 2c 20 69 6e 74 20 | 72 69 67 68 74 2c 20 69 |op, int |right, i|
|00000650| 6e 74 20 62 6f 74 74 6f | 6d 29 3b 20 20 20 0d 20 |nt botto|m); . |
|00000660| 20 20 76 69 72 74 75 61 | 6c 20 73 68 6f 72 74 20 | virtua|l short |
|00000670| 43 6c 6f 73 65 28 76 6f | 69 64 29 3b 0d 20 20 70 |Close(vo|id);. p|
|00000680| 72 6f 74 65 63 74 65 64 | 3a 0d 20 20 20 76 69 72 |rotected|:. vir|
|00000690| 74 75 61 6c 20 76 6f 69 | 64 20 53 65 74 44 65 66 |tual voi|d SetDef|
|000006a0| 61 75 6c 74 73 28 76 6f | 69 64 29 3b 0d 20 20 20 |aults(vo|id);. |
|000006b0| 76 69 72 74 75 61 6c 20 | 76 6f 69 64 20 64 6f 4b |virtual |void doK|
|000006c0| 65 79 28 63 68 61 72 20 | 63 68 29 3b 0d 20 20 20 |ey(char |ch);. |
|000006d0| 76 69 72 74 75 61 6c 20 | 76 6f 69 64 20 64 6f 43 |virtual |void doC|
|000006e0| 6f 6e 74 65 6e 74 43 6c | 69 63 6b 28 50 6f 69 6e |ontentCl|ick(Poin|
|000006f0| 74 20 6c 6f 63 61 6c 50 | 74 29 3b 0d 20 20 20 76 |t localP|t);. v|
|00000700| 69 72 74 75 61 6c 20 76 | 6f 69 64 20 61 64 6a 75 |irtual v|oid adju|
|00000710| 73 74 54 6f 4e 65 77 53 | 69 7a 65 28 76 6f 69 64 |stToNewS|ize(void|
|00000720| 29 3b 0d 20 20 20 76 69 | 72 74 75 61 6c 20 76 6f |);. vi|rtual vo|
|00000730| 69 64 20 64 6f 52 65 64 | 72 61 77 28 52 65 63 74 |id doRed|raw(Rect|
|00000740| 2a 20 62 61 64 52 65 63 | 74 29 3b 0d 20 20 20 76 |* badRec|t);. v|
|00000750| 69 72 74 75 61 6c 20 76 | 6f 69 64 20 64 6f 48 53 |irtual v|oid doHS|
|00000760| 63 72 6f 6c 6c 28 69 6e | 74 20 64 68 29 3b 0d 20 |croll(in|t dh);. |
|00000770| 20 20 76 69 72 74 75 61 | 6c 20 76 6f 69 64 20 64 | virtua|l void d|
|00000780| 6f 56 53 63 72 6f 6c 6c | 28 69 6e 74 20 64 76 29 |oVScroll|(int dv)|
|00000790| 3b 0d 20 20 20 76 69 72 | 74 75 61 6c 20 76 6f 69 |;. vir|tual voi|
|000007a0| 64 20 64 6f 41 63 74 69 | 76 61 74 65 28 69 6e 74 |d doActi|vate(int|
|000007b0| 20 61 63 74 69 76 65 29 | 3b 0d 7d 3b 0d 0d 76 6f | active)|;.};..vo|
|000007c0| 69 64 20 6d 79 57 69 6e | 64 6f 77 3a 3a 53 65 74 |id myWin|dow::Set|
|000007d0| 44 65 66 61 75 6c 74 73 | 28 76 6f 69 64 29 20 7b |Defaults|(void) {|
|000007e0| 0d 20 20 20 69 6e 68 65 | 72 69 74 65 64 3a 3a 53 |. inhe|rited::S|
|000007f0| 65 74 44 65 66 61 75 6c | 74 73 28 29 3b 0d 20 20 |etDefaul|ts();. |
|00000800| 20 68 4c 69 6e 65 73 50 | 65 72 50 61 67 65 20 3d | hLinesP|erPage =|
|00000810| 20 31 35 3b 20 20 20 2f | 2f 20 41 20 63 6c 69 63 | 15; /|/ A clic|
|00000820| 6b 20 69 6e 20 74 68 65 | 20 67 72 61 79 20 61 72 |k in the| gray ar|
|00000830| 65 61 20 6f 66 20 74 68 | 65 20 68 6f 72 69 7a 6f |ea of th|e horizo|
|00000840| 6e 74 61 6c 20 73 63 72 | 6f 6c 6c 0d 20 20 20 20 |ntal scr|oll. |
|00000850| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000860| 20 20 20 20 20 2f 2f 20 | 62 61 72 20 77 69 6c 6c | // |bar will|
|00000870| 20 68 61 76 65 20 61 6e | 20 65 66 66 65 63 74 20 | have an| effect |
|00000880| 31 35 20 74 69 6d 65 73 | 20 61 73 20 62 69 67 20 |15 times| as big |
|00000890| 61 73 20 61 20 0d 20 20 | 20 20 20 20 20 20 20 20 |as a . | |
|000008a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|000008b0| 2f 20 63 6c 69 63 6b 20 | 6f 6e 20 6f 6e 20 61 72 |/ click |on on ar|
|000008c0| 72 6f 77 2e 0d 20 20 20 | 76 4c 69 6e 65 73 50 65 |row.. |vLinesPe|
|000008d0| 72 50 61 67 65 20 3d 20 | 31 35 3b 20 20 20 2f 2f |rPage = |15; //|
|000008e0| 20 53 69 6d 69 6c 61 72 | 6c 79 20 66 6f 72 20 74 | Similar|ly for t|
|000008f0| 68 65 20 76 65 72 74 69 | 63 61 6c 20 73 63 72 6f |he verti|cal scro|
|00000900| 6c 6c 20 62 61 72 2e 0d | 7d 0d 0d 76 6f 69 64 20 |ll bar..|}..void |
|00000910| 6d 79 57 69 6e 64 6f 77 | 3a 3a 4f 70 65 6e 49 6e |myWindow|::OpenIn|
|00000920| 52 65 63 74 28 53 74 72 | 32 35 35 20 74 69 74 6c |Rect(Str|255 titl|
|00000930| 65 2c 20 69 6e 74 20 6c | 65 66 74 2c 20 69 6e 74 |e, int l|eft, int|
|00000940| 20 74 6f 70 2c 20 69 6e | 74 20 72 69 67 68 74 2c | top, in|t right,|
|00000950| 20 69 6e 74 20 62 6f 74 | 74 6f 6d 29 20 7b 0d 20 | int bot|tom) {. |
|00000960| 20 20 69 6e 68 65 72 69 | 74 65 64 3a 3a 4f 70 65 | inheri|ted::Ope|
|00000970| 6e 49 6e 52 65 63 74 28 | 74 69 74 6c 65 2c 6c 65 |nInRect(|title,le|
|00000980| 66 74 2c 74 6f 70 2c 72 | 69 67 68 74 2c 62 6f 74 |ft,top,r|ight,bot|
|00000990| 74 6f 6d 29 3b 0d 7d 0d | 0d 73 68 6f 72 74 20 6d |tom);.}.|.short m|
|000009a0| 79 57 69 6e 64 6f 77 3a | 3a 43 6c 6f 73 65 28 76 |yWindow:|:Close(v|
|000009b0| 6f 69 64 29 20 7b 0d 20 | 20 20 69 6e 68 65 72 69 |oid) {. | inheri|
|000009c0| 74 65 64 3a 3a 43 6c 6f | 73 65 28 29 3b 0d 7d 0d |ted::Clo|se();.}.|
|000009d0| 0d 76 6f 69 64 20 6d 79 | 57 69 6e 64 6f 77 3a 3a |.void my|Window::|
|000009e0| 64 6f 4b 65 79 28 63 68 | 61 72 20 63 68 29 20 7b |doKey(ch|ar ch) {|
|000009f0| 0d 7d 0d 0d 76 6f 69 64 | 20 6d 79 57 69 6e 64 6f |.}..void| myWindo|
|00000a00| 77 3a 3a 64 6f 43 6f 6e | 74 65 6e 74 43 6c 69 63 |w::doCon|tentClic|
|00000a10| 6b 28 50 6f 69 6e 74 20 | 6c 6f 63 61 6c 50 74 29 |k(Point |localPt)|
|00000a20| 20 7b 0d 7d 0d 0d 0d 2f | 2f 20 46 75 6e 63 74 69 | {.}.../|/ Functi|
|00000a30| 6f 6e 20 64 6f 52 65 64 | 72 61 77 20 64 72 61 77 |on doRed|raw draw|
|00000a40| 73 20 61 20 72 65 63 74 | 61 6e 67 6c 65 20 77 68 |s a rect|angle wh|
|00000a50| 6f 73 65 20 68 65 69 67 | 68 74 20 61 6e 64 20 77 |ose heig|ht and w|
|00000a60| 69 64 74 68 20 64 65 70 | 65 6e 64 0d 2f 2f 20 6f |idth dep|end.// o|
|00000a70| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 73 63 |n the cu|rrent sc|
|00000a80| 72 6f 6c 6c 20 62 61 72 | 20 73 65 74 74 69 6e 67 |roll bar| setting|
|00000a90| 73 2e 20 20 53 69 6e 63 | 65 20 74 68 69 73 20 70 |s. Sinc|e this p|
|00000aa0| 72 6f 63 65 64 75 72 65 | 20 69 73 0d 2f 2f 20 63 |rocedure| is.// c|
|00000ab0| 61 6c 6c 65 64 20 62 79 | 20 64 6f 48 53 63 72 6f |alled by| doHScro|
|00000ac0| 6c 6c 20 6f 72 20 64 6f | 56 53 63 72 6f 6c 6c 20 |ll or do|VScroll |
|00000ad0| 77 68 65 6e 20 74 68 65 | 20 75 73 65 72 20 63 6c |when the| user cl|
|00000ae0| 69 63 6b 73 20 6f 6e 20 | 74 68 65 20 73 63 72 6f |icks on |the scro|
|00000af0| 6c 6c 20 62 61 72 2c 0d | 2f 2f 20 74 68 65 20 73 |ll bar,.|// the s|
|00000b00| 69 7a 65 20 6f 66 20 74 | 68 65 20 72 65 63 74 61 |ize of t|he recta|
|00000b10| 6e 67 6c 65 20 63 68 61 | 6e 67 65 73 20 77 68 69 |ngle cha|nges whi|
|00000b20| 6c 65 20 74 68 65 20 75 | 73 65 72 20 63 6f 6e 74 |le the u|ser cont|
|00000b30| 69 6e 75 65 73 20 74 6f | 20 73 63 72 6f 6c 6c 2e |inues to| scroll.|
|00000b40| 0d 2f 2f 20 4e 6f 74 65 | 20 74 68 65 20 66 6c 69 |.// Note| the fli|
|00000b50| 63 6b 65 72 69 6e 67 20 | 65 66 66 65 63 74 20 63 |ckering |effect c|
|00000b60| 61 75 73 65 64 20 62 79 | 20 74 68 65 20 75 73 65 |aused by| the use|
|00000b70| 20 6f 66 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 | of the |default |
|00000b80| 64 6f 48 53 63 72 6f 6c | 6c 0d 2f 2f 20 61 6e 64 |doHScrol|l.// and|
|00000b90| 20 64 6f 56 53 63 72 6f | 6c 6c 2c 20 77 68 69 63 | doVScro|ll, whic|
|00000ba0| 68 20 65 72 61 73 65 20 | 74 68 65 20 73 63 72 65 |h erase |the scre|
|00000bb0| 65 6e 20 62 65 66 6f 72 | 65 20 63 61 6c 6c 69 6e |en befor|e callin|
|00000bc0| 67 20 64 6f 52 65 64 72 | 61 77 2e 0d 0d 76 6f 69 |g doRedr|aw...voi|
|00000bd0| 64 20 6d 79 57 69 6e 64 | 6f 77 3a 3a 64 6f 52 65 |d myWind|ow::doRe|
|00000be0| 64 72 61 77 28 52 65 63 | 74 2a 20 62 61 64 52 65 |draw(Rec|t* badRe|
|00000bf0| 63 74 29 7b 0d 20 20 20 | 52 65 63 74 20 52 3b 0d |ct){. |Rect R;.|
|00000c00| 20 20 20 73 68 6f 72 74 | 20 68 56 61 6c 2c 76 56 | short| hVal,vV|
|00000c10| 61 6c 3b 0d 20 20 20 52 | 20 3d 20 74 68 65 57 69 |al;. R| = theWi|
|00000c20| 6e 64 6f 77 2d 3e 70 6f | 72 74 52 65 63 74 3b 20 |ndow->po|rtRect; |
|00000c30| 20 2f 2f 20 74 68 69 73 | 20 69 73 20 61 20 72 65 | // this| is a re|
|00000c40| 63 74 61 6e 67 6c 65 20 | 74 68 61 74 20 63 6f 76 |ctangle |that cov|
|00000c50| 65 72 73 20 74 68 65 20 | 77 68 6f 6c 65 20 77 69 |ers the |whole wi|
|00000c60| 6e 64 6f 77 0d 20 20 20 | 52 2e 62 6f 74 74 6f 6d |ndow. |R.bottom|
|00000c70| 20 3d 20 52 2e 62 6f 74 | 74 6f 6d 20 2d 20 31 35 | = R.bot|tom - 15|
|00000c80| 3b 20 2f 2f 20 64 6f 6e | 27 74 20 69 6e 63 6c 75 |; // don|'t inclu|
|00000c90| 64 65 20 73 70 61 63 65 | 20 6f 63 63 75 70 69 65 |de space| occupie|
|00000ca0| 64 20 62 79 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 |d by hor|izontal |
|00000cb0| 73 63 72 6f 6c 6c 0d 20 | 20 20 52 2e 72 69 67 68 |scroll. | R.righ|
|00000cc0| 74 20 3d 20 52 2e 72 69 | 67 68 74 20 2d 20 31 35 |t = R.ri|ght - 15|
|00000cd0| 3b 20 20 20 2f 2f 20 6f | 72 20 76 65 72 74 69 63 |; // o|r vertic|
|00000ce0| 61 6c 20 73 63 72 6f 6c | 6c 0d 20 20 20 68 56 61 |al scrol|l. hVa|
|00000cf0| 6c 20 3d 20 47 65 74 48 | 56 61 6c 28 29 3b 20 20 |l = GetH|Val(); |
|00000d00| 2f 2f 20 67 65 74 20 63 | 75 72 72 65 6e 74 20 73 |// get c|urrent s|
|00000d10| 65 74 74 69 6e 67 20 6f | 66 20 68 6f 72 69 7a 6f |etting o|f horizo|
|00000d20| 6e 74 61 6c 20 73 63 72 | 6f 6c 6c 20 62 61 72 0d |ntal scr|oll bar.|
|00000d30| 20 20 20 76 56 61 6c 20 | 3d 20 47 65 74 56 56 61 | vVal |= GetVVa|
|00000d40| 6c 28 29 3b 20 20 2f 2f | 20 67 65 74 20 63 75 72 |l(); //| get cur|
|00000d50| 72 65 6e 74 20 73 65 74 | 74 69 6e 67 20 6f 66 20 |rent set|ting of |
|00000d60| 76 65 72 74 69 63 61 6c | 20 73 63 72 6f 6c 6c 20 |vertical| scroll |
|00000d70| 62 61 72 0d 20 20 20 49 | 6e 73 65 74 52 65 63 74 |bar. I|nsetRect|
|00000d80| 28 26 52 2c 68 56 61 6c | 2c 76 56 61 6c 29 3b 20 |(&R,hVal|,vVal); |
|00000d90| 20 2f 2f 20 72 65 6d 6f | 76 65 20 61 20 62 6f 72 | // remo|ve a bor|
|00000da0| 64 65 72 20 66 72 6f 6d | 20 61 72 6f 75 6e 64 20 |der from| around |
|00000db0| 74 68 65 20 72 65 63 74 | 61 6e 67 6c 65 0d 20 20 |the rect|angle. |
|00000dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000dd0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 77 69 | | // wi|
|00000de0| 74 68 20 73 69 7a 65 20 | 64 65 70 65 6e 64 69 6e |th size |dependin|
|00000df0| 67 20 6f 6e 20 68 56 61 | 6c 20 61 6e 64 20 76 56 |g on hVa|l and vV|
|00000e00| 61 6c 0d 20 20 20 50 61 | 69 6e 74 52 65 63 74 28 |al. Pa|intRect(|
|00000e10| 26 52 29 3b 20 20 20 2f | 2f 20 46 69 6c 6c 20 69 |&R); /|/ Fill i|
|00000e20| 6e 20 74 68 65 20 72 65 | 6d 61 69 6e 69 6e 67 20 |n the re|maining |
|00000e30| 72 65 63 74 61 6e 67 6c | 65 0d 7d 0d 0d 0d 2f 2f |rectangl|e.}...//|
|00000e40| 20 53 65 74 73 20 74 68 | 65 20 6d 61 78 69 6d 75 | Sets th|e maximu|
|00000e50| 6d 20 76 61 6c 75 65 73 | 20 6f 6e 20 74 68 65 20 |m values| on the |
|00000e60| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 61 6e 64 20 76 |horizont|al and v|
|00000e70| 65 72 74 69 63 61 6c 20 | 73 63 72 6f 6c 6c 73 20 |ertical |scrolls |
|00000e80| 74 6f 0d 2f 2f 20 61 70 | 70 72 6f 70 72 69 61 74 |to.// ap|propriat|
|00000e90| 65 20 76 61 6c 75 65 73 | 20 66 6f 72 20 74 68 65 |e values| for the|
|00000ea0| 20 77 69 6e 64 6f 77 2e | 0d 0d 76 6f 69 64 20 6d | window.|..void m|
|00000eb0| 79 57 69 6e 64 6f 77 3a | 3a 61 64 6a 75 73 74 54 |yWindow:|:adjustT|
|00000ec0| 6f 4e 65 77 53 69 7a 65 | 28 76 6f 69 64 29 20 7b |oNewSize|(void) {|
|00000ed0| 0d 20 20 20 52 65 63 74 | 20 52 3b 0d 20 20 20 73 |. Rect| R;. s|
|00000ee0| 68 6f 72 74 20 68 65 69 | 67 68 74 2c 77 69 64 74 |hort hei|ght,widt|
|00000ef0| 68 3b 0d 0d 20 20 20 69 | 6e 68 65 72 69 74 65 64 |h;.. i|nherited|
|00000f00| 3a 3a 61 64 6a 75 73 74 | 54 6f 4e 65 77 53 69 7a |::adjust|ToNewSiz|
|00000f10| 65 28 29 3b 0d 0d 20 20 | 20 52 20 3d 20 74 68 65 |e();.. | R = the|
|00000f20| 57 69 6e 64 6f 77 2d 3e | 70 6f 72 74 52 65 63 74 |Window->|portRect|
|00000f30| 3b 20 20 2f 2f 20 74 68 | 69 73 20 69 73 20 61 20 |; // th|is is a |
|00000f40| 72 65 63 74 61 6e 67 6c | 65 20 74 68 61 74 20 63 |rectangl|e that c|
|00000f50| 6f 76 65 72 73 20 74 68 | 65 20 77 68 6f 6c 65 20 |overs th|e whole |
|00000f60| 77 69 6e 64 6f 77 0d 20 | 20 20 52 2e 62 6f 74 74 |window. | R.bott|
|00000f70| 6f 6d 20 3d 20 52 2e 62 | 6f 74 74 6f 6d 20 2d 20 |om = R.b|ottom - |
|00000f80| 31 35 3b 20 2f 2f 20 64 | 6f 6e 27 74 20 69 6e 63 |15; // d|on't inc|
|00000f90| 6c 75 64 65 20 73 70 61 | 63 65 20 6f 63 63 75 70 |lude spa|ce occup|
|00000fa0| 69 65 64 20 62 79 20 68 | 6f 72 69 7a 6f 6e 74 61 |ied by h|orizonta|
|00000fb0| 6c 20 73 63 72 6f 6c 6c | 0d 20 20 20 52 2e 72 69 |l scroll|. R.ri|
|00000fc0| 67 68 74 20 3d 20 52 2e | 72 69 67 68 74 20 2d 20 |ght = R.|right - |
|00000fd0| 31 35 3b 20 20 20 2f 2f | 20 6f 72 20 76 65 72 74 |15; //| or vert|
|00000fe0| 69 63 61 6c 20 73 63 72 | 6f 6c 6c 0d 0d 20 20 20 |ical scr|oll.. |
|00000ff0| 68 65 69 67 68 74 20 3d | 20 52 2e 62 6f 74 74 6f |height =| R.botto|
|00001000| 6d 20 2d 20 52 2e 74 6f | 70 3b 20 20 2f 2f 20 68 |m - R.to|p; // h|
|00001010| 65 69 67 68 74 20 6f 66 | 20 77 69 6e 64 6f 77 0d |eight of| window.|
|00001020| 20 20 20 77 69 64 74 68 | 20 3d 20 52 2e 72 69 67 | width| = R.rig|
|00001030| 68 74 20 2d 20 52 2e 6c | 65 66 74 3b 20 20 20 20 |ht - R.l|eft; |
|00001040| 2f 2f 20 77 69 64 74 68 | 20 6f 66 20 77 69 6e 64 |// width| of wind|
|00001050| 6f 77 0d 0d 20 20 20 53 | 65 74 48 4d 61 78 28 28 |ow.. S|etHMax((|
|00001060| 77 69 64 74 68 2d 31 29 | 20 2f 20 32 29 3b 20 20 |width-1)| / 2); |
|00001070| 20 2f 2f 20 73 65 74 20 | 6d 61 78 69 6d 75 6d 20 | // set |maximum |
|00001080| 70 6f 73 73 69 62 6c 65 | 20 76 61 6c 75 65 20 6f |possible| value o|
|00001090| 66 20 73 63 72 6f 6c 6c | 20 62 61 72 73 0d 20 20 |f scroll| bars. |
|000010a0| 20 53 65 74 56 4d 61 78 | 28 28 68 65 69 67 68 74 | SetVMax|((height|
|000010b0| 2d 31 29 20 2f 20 32 29 | 3b 0d 20 20 20 2f 2f 20 |-1) / 2)|;. // |
|000010c0| 4e 4f 54 45 3a 20 54 68 | 65 20 76 61 6c 75 65 73 |NOTE: Th|e values|
|000010d0| 20 75 73 65 64 20 68 65 | 72 65 20 61 72 65 20 73 | used he|re are s|
|000010e0| 69 6d 70 6c 79 20 74 68 | 65 20 6c 61 72 67 65 73 |imply th|e larges|
|000010f0| 74 20 76 61 6c 75 65 73 | 20 62 79 20 77 68 69 63 |t values| by whic|
|00001100| 68 0d 20 20 20 2f 2f 20 | 20 20 20 20 20 20 74 68 |h. // | th|
|00001110| 65 20 72 65 63 74 61 6e | 67 65 6c 20 63 61 6e 20 |e rectan|gel can |
|00001120| 62 65 20 22 69 6e 73 65 | 74 22 20 69 6e 20 66 75 |be "inse|t" in fu|
|00001130| 6e 63 74 69 6f 6e 20 64 | 6f 52 65 64 72 61 77 20 |nction d|oRedraw |
|00001140| 77 69 74 68 6f 75 74 0d | 20 20 20 2f 2f 20 20 20 |without.| // |
|00001150| 20 20 20 20 61 63 74 75 | 61 6c 6c 79 20 6d 61 6b | actu|ally mak|
|00001160| 69 6e 67 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c |ing the |rectangl|
|00001170| 65 20 64 69 73 61 70 70 | 65 61 72 2e 0d 7d 0d 0d |e disapp|ear..}..|
|00001180| 0d 76 6f 69 64 20 6d 79 | 57 69 6e 64 6f 77 3a 3a |.void my|Window::|
|00001190| 64 6f 48 53 63 72 6f 6c | 6c 28 69 6e 74 20 64 68 |doHScrol|l(int dh|
|000011a0| 29 20 7b 0d 20 20 20 69 | 6e 68 65 72 69 74 65 64 |) {. i|nherited|
|000011b0| 3a 3a 64 6f 48 53 63 72 | 6f 6c 6c 28 64 68 29 3b |::doHScr|oll(dh);|
|000011c0| 0d 7d 0d 0d 76 6f 69 64 | 20 6d 79 57 69 6e 64 6f |.}..void| myWindo|
|000011d0| 77 3a 3a 64 6f 56 53 63 | 72 6f 6c 6c 28 69 6e 74 |w::doVSc|roll(int|
|000011e0| 20 64 76 29 20 7b 0d 20 | 20 20 69 6e 68 65 72 69 | dv) {. | inheri|
|000011f0| 74 65 64 3a 3a 64 6f 56 | 53 63 72 6f 6c 6c 28 64 |ted::doV|Scroll(d|
|00001200| 76 29 3b 0d 7d 0d 0d 76 | 6f 69 64 20 6d 79 57 69 |v);.}..v|oid myWi|
|00001210| 6e 64 6f 77 3a 3a 64 6f | 41 63 74 69 76 61 74 65 |ndow::do|Activate|
|00001220| 28 69 6e 74 20 61 63 74 | 69 76 65 29 20 7b 0d 20 |(int act|ive) {. |
|00001230| 20 20 69 6e 68 65 72 69 | 74 65 64 3a 3a 64 6f 41 | inheri|ted::doA|
|00001240| 63 74 69 76 61 74 65 28 | 61 63 74 69 76 65 29 3b |ctivate(|active);|
|00001250| 0d 7d 0d 0d 76 6f 69 64 | 20 49 6e 69 74 41 70 70 |.}..void| InitApp|
|00001260| 6c 69 63 61 74 69 6f 6e | 28 76 6f 69 64 29 20 7b |lication|(void) {|
|00001270| 0d 20 20 4d 65 6e 75 48 | 61 6e 64 6c 65 20 61 70 |. MenuH|andle ap|
|00001280| 70 6c 65 4d 65 6e 75 3b | 0d 20 20 66 69 6e 67 65 |pleMenu;|. finge|
|00001290| 72 43 75 72 73 6f 72 20 | 3d 20 47 65 74 43 75 72 |rCursor |= GetCur|
|000012a0| 73 6f 72 28 31 32 39 29 | 3b 20 20 2f 2f 20 6c 6f |sor(129)|; // lo|
|000012b0| 61 64 20 74 68 65 20 22 | 70 6f 69 6e 74 69 6e 67 |ad the "|pointing|
|000012c0| 20 66 69 6e 67 65 72 20 | 63 75 72 73 6f 72 22 0d | finger |cursor".|
|000012d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000012e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000012f0| 20 20 2f 2f 20 66 72 6f | 6d 20 74 68 65 20 72 65 | // fro|m the re|
|00001300| 73 6f 75 72 63 65 20 66 | 69 6c 65 2e 0d 20 20 66 |source f|ile.. f|
|00001310| 69 6c 65 4d 65 6e 75 20 | 3d 20 47 65 74 4d 48 61 |ileMenu |= GetMHa|
|00001320| 6e 64 6c 65 28 32 29 3b | 0d 20 20 65 64 69 74 4d |ndle(2);|. editM|
|00001330| 65 6e 75 20 3d 20 47 65 | 74 4d 48 61 6e 64 6c 65 |enu = Ge|tMHandle|
|00001340| 28 33 29 3b 0d 20 20 61 | 70 70 6c 65 4d 65 6e 75 |(3);. a|ppleMenu|
|00001350| 20 3d 20 47 65 74 4d 48 | 61 6e 64 6c 65 28 31 29 | = GetMH|andle(1)|
|00001360| 3b 0d 20 20 53 65 74 49 | 74 65 6d 28 61 70 70 6c |;. SetI|tem(appl|
|00001370| 65 4d 65 6e 75 2c 31 2c | 22 5c 70 41 62 6f 75 74 |eMenu,1,|"\pAbout|
|00001380| 20 53 74 75 70 69 64 53 | 63 72 6f 6c 6c 2e 2e 2e | StupidS|croll...|
|00001390| 22 29 3b 20 20 2f 2f 20 | 53 65 74 73 20 74 68 65 |"); // |Sets the|
|000013a0| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 0d 20 20 44 | name of| the. D|
|000013b0| 6f 4e 65 77 43 6f 6d 6d | 61 6e 64 28 29 3b 20 20 |oNewComm|and(); |
|000013c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000013d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000013e0| 2f 2f 20 70 72 6f 67 72 | 61 6d 20 69 6e 20 66 69 |// progr|am in fi|
|000013f0| 72 73 74 20 6c 69 6e 65 | 20 6f 66 0d 7d 20 20 20 |rst line| of.} |
|00001400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00001430| 2f 20 74 68 65 20 41 70 | 70 6c 65 20 6d 65 6e 75 |/ the Ap|ple menu|
|00001440| 0d 0d 76 6f 69 64 20 55 | 70 64 61 74 65 4d 65 6e |..void U|pdateMen|
|00001450| 75 73 28 76 6f 69 64 29 | 20 7b 0d 20 20 20 73 68 |us(void)| {. sh|
|00001460| 6f 72 74 20 69 3b 0d 20 | 20 20 57 69 6e 64 6f 77 |ort i;. | Window|
|00001470| 50 74 72 20 77 69 6e 3b | 0d 20 20 20 78 57 69 6e |Ptr win;|. xWin|
|00001480| 64 6f 77 20 2a 78 77 69 | 6e 3b 0d 20 20 20 77 69 |dow *xwi|n;. wi|
|00001490| 6e 20 3d 20 46 72 6f 6e | 74 57 69 6e 64 6f 77 28 |n = Fron|tWindow(|
|000014a0| 29 3b 0d 20 20 20 69 66 | 20 28 20 77 69 6e 20 26 |);. if| ( win &|
|000014b0| 26 20 28 28 57 69 6e 64 | 6f 77 50 65 65 6b 29 77 |& ((Wind|owPeek)w|
|000014c0| 69 6e 29 2d 3e 77 69 6e | 64 6f 77 4b 69 6e 64 20 |in)->win|dowKind |
|000014d0| 3c 20 30 20 29 20 7b 20 | 20 0d 20 20 20 20 20 20 |< 0 ) { | . |
|000014e0| 45 6e 61 62 6c 65 49 74 | 65 6d 28 65 64 69 74 4d |EnableIt|em(editM|
|000014f0| 65 6e 75 2c 31 29 3b 0d | 20 20 20 20 20 20 66 6f |enu,1);.| fo|
|00001500| 72 20 28 69 3d 33 3b 20 | 69 3c 37 3b 20 69 2b 2b |r (i=3; |i<7; i++|
|00001510| 29 0d 20 20 20 20 20 20 | 20 20 20 45 6e 61 62 6c |). | Enabl|
|00001520| 65 49 74 65 6d 28 65 64 | 69 74 4d 65 6e 75 2c 69 |eItem(ed|itMenu,i|
|00001530| 29 3b 0d 20 20 20 7d 0d | 20 20 20 65 6c 73 65 20 |);. }.| else |
|00001540| 7b 0d 20 20 20 20 20 20 | 44 69 73 61 62 6c 65 49 |{. |DisableI|
|00001550| 74 65 6d 28 65 64 69 74 | 4d 65 6e 75 2c 31 29 3b |tem(edit|Menu,1);|
|00001560| 0d 20 20 20 20 20 20 66 | 6f 72 20 28 69 3d 33 3b |. f|or (i=3;|
|00001570| 20 69 3c 37 3b 20 69 2b | 2b 29 0d 20 20 20 20 20 | i<7; i+|+). |
|00001580| 20 20 20 20 44 69 73 61 | 62 6c 65 49 74 65 6d 28 | Disa|bleItem(|
|00001590| 65 64 69 74 4d 65 6e 75 | 2c 69 29 3b 0d 20 20 20 |editMenu|,i);. |
|000015a0| 7d 0d 20 20 20 69 66 20 | 28 77 69 6e 20 26 26 20 |}. if |(win && |
|000015b0| 78 57 69 6e 64 6f 77 3a | 3a 57 69 6e 64 6f 77 32 |xWindow:|:Window2|
|000015c0| 58 57 69 6e 64 6f 77 28 | 77 69 6e 2c 26 78 77 69 |XWindow(|win,&xwi|
|000015d0| 6e 29 29 20 7b 0d 20 20 | 20 20 20 20 45 6e 61 62 |n)) {. | Enab|
|000015e0| 6c 65 49 74 65 6d 28 66 | 69 6c 65 4d 65 6e 75 2c |leItem(f|ileMenu,|
|000015f0| 32 29 3b 0d 20 20 20 7d | 0d 20 20 20 65 6c 73 65 |2);. }|. else|
|00001600| 20 7b 0d 20 20 20 20 20 | 20 44 69 73 61 62 6c 65 | {. | Disable|
|00001610| 49 74 65 6d 28 66 69 6c | 65 4d 65 6e 75 2c 32 29 |Item(fil|eMenu,2)|
|00001620| 3b 0d 20 20 20 7d 0d 7d | 0d 0d 76 6f 69 64 20 44 |;. }.}|..void D|
|00001630| 6f 45 64 69 74 4d 65 6e | 75 28 69 6e 74 20 69 74 |oEditMen|u(int it|
|00001640| 65 6d 4e 75 6d 29 20 7b | 0d 7d 0d 0d 76 6f 69 64 |emNum) {|.}..void|
|00001650| 20 44 6f 46 69 6c 65 4d | 65 6e 75 28 69 6e 74 20 | DoFileM|enu(int |
|00001660| 69 74 65 6d 4e 75 6d 2c | 20 69 6e 74 2a 20 64 6f |itemNum,| int* do|
|00001670| 6e 65 29 20 7b 0d 20 20 | 20 78 57 69 6e 64 6f 77 |ne) {. | xWindow|
|00001680| 20 2a 77 69 6e 3b 0d 20 | 20 20 69 66 20 28 69 74 | *win;. | if (it|
|00001690| 65 6d 4e 75 6d 20 3d 3d | 20 34 29 0d 20 20 20 20 |emNum ==| 4). |
|000016a0| 20 20 2a 64 6f 6e 65 20 | 3d 20 31 3b 0d 20 20 20 | *done |= 1;. |
|000016b0| 65 6c 73 65 20 69 66 20 | 28 69 74 65 6d 4e 75 6d |else if |(itemNum|
|000016c0| 20 3d 3d 20 31 29 0d 20 | 20 20 20 20 20 44 6f 4e | == 1). | DoN|
|000016d0| 65 77 43 6f 6d 6d 61 6e | 64 28 29 3b 0d 20 20 20 |ewComman|d();. |
|000016e0| 65 6c 73 65 20 69 66 20 | 28 69 74 65 6d 4e 75 6d |else if |(itemNum|
|000016f0| 20 3d 3d 20 32 20 26 26 | 20 78 57 69 6e 64 6f 77 | == 2 &&| xWindow|
|00001700| 3a 3a 57 69 6e 64 6f 77 | 32 58 57 69 6e 64 6f 77 |::Window|2XWindow|
|00001710| 28 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 2c 26 |(FrontWi|ndow(),&|
|00001720| 77 69 6e 29 29 0d 20 20 | 20 20 20 20 77 69 6e 2d |win)). | win-|
|00001730| 3e 43 6c 6f 73 65 28 29 | 3b 0d 7d 0d 0d 76 6f 69 |>Close()|;.}..voi|
|00001740| 64 20 44 6f 4f 74 68 65 | 72 4d 65 6e 75 28 69 6e |d DoOthe|rMenu(in|
|00001750| 74 20 6d 65 6e 75 49 44 | 2c 20 69 6e 74 20 69 74 |t menuID|, int it|
|00001760| 65 6d 4e 75 6d 29 20 7b | 0d 7d 0d 0d 0d 2f 2f 20 |emNum) {|.}...// |
|00001770| 41 70 70 6c 69 63 61 74 | 69 6f 6e 49 64 6c 65 20 |Applicat|ionIdle |
|00001780| 63 68 65 63 6b 73 20 74 | 68 65 20 63 75 72 72 65 |checks t|he curre|
|00001790| 6e 74 20 6d 6f 75 73 65 | 20 70 6f 73 69 74 69 6f |nt mouse| positio|
|000017a0| 6e 20 61 6e 64 20 75 73 | 65 73 20 69 74 20 74 6f |n and us|es it to|
|000017b0| 20 64 65 74 65 72 6d 69 | 6e 65 0d 2f 2f 20 77 68 | determi|ne.// wh|
|000017c0| 69 63 68 20 73 74 79 6c | 65 20 6f 66 20 63 75 72 |ich styl|e of cur|
|000017d0| 73 6f 72 20 73 68 6f 75 | 6c 64 20 62 65 20 75 73 |sor shou|ld be us|
|000017e0| 65 64 2e 20 20 49 6e 20 | 74 68 69 73 20 70 72 6f |ed. In |this pro|
|000017f0| 67 72 61 6d 2c 20 74 68 | 65 20 61 72 72 6f 77 0d |gram, th|e arrow.|
|00001800| 2f 2f 20 63 75 72 73 6f | 72 20 69 73 20 75 73 65 |// curso|r is use|
|00001810| 64 20 65 78 63 65 70 74 | 20 77 68 65 6e 20 74 68 |d except| when th|
|00001820| 65 20 6d 6f 75 73 65 20 | 69 73 20 6f 76 65 72 20 |e mouse |is over |
|00001830| 61 20 73 63 72 6f 6c 6c | 20 62 61 72 3b 20 69 6e |a scroll| bar; in|
|00001840| 20 74 68 61 74 0d 2f 2f | 20 63 61 73 65 2c 20 61 | that.//| case, a|
|00001850| 20 70 6f 69 6e 74 69 6e | 67 20 66 69 6e 67 65 72 | pointin|g finger|
|00001860| 20 63 75 72 73 6f 72 20 | 69 73 20 75 73 65 64 2e | cursor |is used.|
|00001870| 0d 2f 2f 20 20 20 20 48 | 69 6e 74 3a 20 20 49 66 |.// H|int: If|
|00001880| 20 79 6f 75 20 67 65 74 | 20 73 65 72 69 6f 75 73 | you get| serious|
|00001890| 20 61 62 6f 75 74 20 63 | 75 72 73 6f 72 2d 73 65 | about c|ursor-se|
|000018a0| 74 74 69 6e 67 2c 20 79 | 6f 75 20 77 69 6c 6c 20 |tting, y|ou will |
|000018b0| 70 72 6f 62 61 62 6c 79 | 0d 2f 2f 20 77 61 6e 74 |probably|.// want|
|000018c0| 20 74 6f 20 70 75 74 20 | 61 20 53 65 74 43 75 72 | to put |a SetCur|
|000018d0| 73 6f 72 28 26 61 72 72 | 6f 77 29 20 61 74 20 74 |sor(&arr|ow) at t|
|000018e0| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |he begin|ning of |
|000018f0| 65 61 63 68 20 6d 65 6e | 75 2d 68 61 6e 64 6c 69 |each men|u-handli|
|00001900| 6e 67 0d 2f 2f 20 70 72 | 6f 63 65 64 75 72 65 2e |ng.// pr|ocedure.|
|00001910| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 79 6f 75 20 | Otherwi|se, you |
|00001920| 63 61 6e 20 67 65 74 20 | 73 74 75 63 6b 20 77 69 |can get |stuck wi|
|00001930| 74 68 20 61 20 66 75 6e | 6e 79 20 63 75 72 73 6f |th a fun|ny curso|
|00001940| 72 20 77 68 69 6c 65 0d | 2f 2f 20 61 20 6d 65 6e |r while.|// a men|
|00001950| 75 20 63 6f 6d 6d 61 6e | 64 20 69 73 20 62 65 69 |u comman|d is bei|
|00001960| 6e 67 20 63 61 72 72 69 | 65 64 20 6f 75 74 2e 20 |ng carri|ed out. |
|00001970| 20 28 54 68 69 73 20 69 | 73 20 61 6e 6e 6f 79 69 | (This i|s annoyi|
|00001980| 6e 67 20 69 66 20 74 68 | 65 0d 2f 2f 20 63 6f 6d |ng if th|e.// com|
|00001990| 6d 61 6e 64 20 62 72 69 | 6e 67 73 20 75 70 20 61 |mand bri|ngs up a|
|000019a0| 20 64 69 61 6c 6f 67 20 | 62 6f 78 2e 29 20 20 4e | dialog |box.) N|
|000019b0| 6f 74 65 20 74 68 61 74 | 20 22 61 72 72 6f 77 22 |ote that| "arrow"|
|000019c0| 20 69 73 20 61 20 70 72 | 65 64 65 66 69 6e 65 64 | is a pr|edefined|
|000019d0| 0d 2f 2f 20 76 61 72 69 | 61 62 6c 65 20 6f 66 20 |.// vari|able of |
|000019e0| 74 79 70 65 20 43 75 72 | 73 6f 72 2e 0d 0d 76 6f |type Cur|sor...vo|
|000019f0| 69 64 20 41 70 70 6c 69 | 63 61 74 69 6f 6e 49 64 |id Appli|cationId|
|00001a00| 6c 65 28 76 6f 69 64 29 | 20 7b 0d 0d 20 20 20 50 |le(void)| {.. P|
|00001a10| 6f 69 6e 74 20 70 74 3b | 20 20 20 20 20 20 20 20 |oint pt;| |
|00001a20| 2f 2f 20 6d 6f 75 73 65 | 20 6c 6f 63 61 74 69 6f |// mouse| locatio|
|00001a30| 6e 0d 20 20 20 57 69 6e | 64 6f 77 50 74 72 20 77 |n. Win|dowPtr w|
|00001a40| 69 6e 3b 20 20 20 2f 2f | 20 77 69 6e 64 6f 77 20 |in; //| window |
|00001a50| 63 6f 6e 74 69 6e 69 6e | 67 20 6d 6f 75 73 65 20 |continin|g mouse |
|00001a60| 28 69 66 20 61 6e 79 29 | 0d 20 20 20 78 57 69 6e |(if any)|. xWin|
|00001a70| 64 6f 77 20 2a 78 77 69 | 6e 3b 20 20 20 2f 2f 20 |dow *xwi|n; // |
|00001a80| 74 68 65 20 78 57 69 6e | 64 6f 77 20 63 6f 72 72 |the xWin|dow corr|
|00001a90| 65 73 70 6f 6e 64 69 6e | 67 20 74 6f 20 77 69 6e |espondin|g to win|
|00001aa0| 0d 20 20 20 73 68 6f 72 | 74 20 70 61 72 74 4e 75 |. shor|t partNu|
|00001ab0| 6d 3b 20 20 20 2f 2f 20 | 52 65 74 75 72 6e 65 64 |m; // |Returned|
|00001ac0| 20 62 79 20 46 69 6e 64 | 57 69 6e 64 6f 77 20 74 | by Find|Window t|
|00001ad0| 6f 20 74 65 6c 6c 20 77 | 68 61 74 20 74 68 65 0d |o tell w|hat the.|
|00001ae0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001af0| 20 20 20 20 2f 2f 20 20 | 20 6d 6f 75 73 65 20 69 | // | mouse i|
|00001b00| 73 20 63 75 72 72 65 6e | 74 6c 79 20 6f 76 65 72 |s curren|tly over|
|00001b10| 2e 0d 20 20 20 47 72 61 | 66 50 74 72 20 73 61 76 |.. Gra|fPtr sav|
|00001b20| 65 50 6f 72 74 3b 20 20 | 20 2f 2f 20 49 20 6e 65 |ePort; | // I ne|
|00001b30| 65 64 20 74 68 69 73 20 | 62 65 63 61 75 73 65 20 |ed this |because |
|00001b40| 49 20 68 61 76 65 20 74 | 6f 20 73 65 74 20 74 68 |I have t|o set th|
|00001b50| 65 20 64 72 61 77 69 6e | 67 0d 20 20 20 20 20 20 |e drawin|g. |
|00001b60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b70| 20 2f 2f 20 20 20 70 6f | 72 74 20 69 6e 20 6f 72 | // po|rt in or|
|00001b80| 64 65 72 20 74 6f 20 75 | 73 65 20 74 68 65 20 66 |der to u|se the f|
|00001b90| 75 6e 63 74 69 6f 6e 20 | 47 6c 6f 62 61 6c 54 6f |unction |GlobalTo|
|00001ba0| 4c 6f 63 61 6c 0d 20 20 | 20 43 6f 6e 74 72 6f 6c |Local. | Control|
|00001bb0| 48 61 6e 64 6c 65 20 74 | 68 65 43 6f 6e 74 72 6f |Handle t|heContro|
|00001bc0| 6c 3b 20 20 20 2f 2f 20 | 49 66 20 74 68 65 20 6d |l; // |If the m|
|00001bd0| 6f 75 73 65 20 69 73 20 | 6f 76 65 72 20 61 20 77 |ouse is |over a w|
|00001be0| 69 6e 64 6f 77 2c 20 49 | 20 68 61 76 65 20 74 6f |indow, I| have to|
|00001bf0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001c00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c10| 2f 2f 20 63 68 65 63 6b | 20 77 68 65 74 68 65 72 |// check| whether|
|00001c20| 20 69 74 20 69 73 20 6f | 76 65 72 20 61 20 22 63 | it is o|ver a "c|
|00001c30| 6f 6e 74 72 6f 6c 22 0d | 20 20 20 20 20 20 20 20 |ontrol".| |
|00001c40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c50| 20 20 20 20 20 20 20 2f | 2f 20 77 68 69 63 68 20 | /|/ which |
|00001c60| 69 6e 20 74 68 69 73 20 | 70 72 6f 67 72 61 6d 20 |in this |program |
|00001c70| 63 61 6e 20 6f 6e 6c 79 | 20 62 65 20 61 0d 20 20 |can only| be a. |
|00001c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2f 20 | | // |
|00001ca0| 73 63 72 6f 6c 6c 20 62 | 61 72 20 69 6e 20 74 68 |scroll b|ar in th|
|00001cb0| 65 20 66 72 6f 6e 74 6d | 6f 73 74 20 77 69 6e 64 |e frontm|ost wind|
|00001cc0| 6f 77 2e 0d 0d 20 20 20 | 70 74 20 3d 20 67 45 76 |ow... |pt = gEv|
|00001cd0| 65 6e 74 2e 77 68 65 72 | 65 3b 20 2f 2f 20 6d 6f |ent.wher|e; // mo|
|00001ce0| 75 73 65 20 6c 6f 63 20 | 69 73 20 74 61 6b 65 6e |use loc |is taken|
|00001cf0| 20 66 72 6f 6d 20 67 6c | 6f 62 61 6c 20 65 76 65 | from gl|obal eve|
|00001d00| 6e 74 20 72 65 63 6f 72 | 64 20 67 45 76 65 6e 74 |nt recor|d gEvent|
|00001d10| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001d20| 20 20 20 20 20 20 20 2f | 2f 20 28 54 68 69 73 20 | /|/ (This |
|00001d30| 6d 69 67 68 74 20 62 65 | 20 73 6c 69 67 68 74 6c |might be| slightl|
|00001d40| 79 20 6f 75 74 2d 6f 66 | 2d 64 61 74 65 3b 20 79 |y out-of|-date; y|
|00001d50| 6f 75 20 63 6f 75 6c 64 | 0d 20 20 20 20 20 20 20 |ou could|. |
|00001d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00001d70| 2f 20 67 65 74 20 61 20 | 6e 65 77 20 65 76 65 6e |/ get a |new even|
|00001d80| 74 20 72 65 63 6f 72 64 | 20 75 73 69 6e 67 20 45 |t record| using E|
|00001d90| 76 65 6e 74 41 76 61 69 | 6c 28 29 20 69 66 20 79 |ventAvai|l() if y|
|00001da0| 6f 75 20 77 61 6e 74 2e | 29 0d 20 20 20 70 61 72 |ou want.|). par|
|00001db0| 74 4e 75 6d 20 3d 20 46 | 69 6e 64 57 69 6e 64 6f |tNum = F|indWindo|
|00001dc0| 77 28 70 74 2c 20 26 77 | 69 6e 29 3b 20 20 2f 2f |w(pt, &w|in); //|
|00001dd0| 20 53 65 74 73 20 77 69 | 6e 3d 30 20 69 66 20 74 | Sets wi|n=0 if t|
|00001de0| 68 65 20 6d 6f 75 73 65 | 20 69 73 20 6e 6f 74 20 |he mouse| is not |
|00001df0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001e00| 20 20 20 20 20 20 20 2f | 2f 20 6f 76 65 72 20 61 | /|/ over a|
|00001e10| 20 77 69 6e 64 6f 77 3b | 20 69 66 20 69 74 20 69 | window;| if it i|
|00001e20| 73 2c 20 70 61 72 74 4e | 75 6d 20 77 69 6c 6c 20 |s, partN|um will |
|00001e30| 68 61 76 65 20 74 68 65 | 0d 20 20 20 20 20 20 20 |have the|. |
|00001e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00001e50| 2f 20 76 61 6c 75 65 20 | 69 6e 43 6f 6e 74 65 6e |/ value |inConten|
|00001e60| 74 20 77 68 65 6e 20 74 | 68 65 20 6d 6f 75 73 65 |t when t|he mouse|
|00001e70| 20 69 73 20 6f 76 65 72 | 20 74 68 65 20 69 6e 73 | is over| the ins|
|00001e80| 69 64 65 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ide. | |
|00001e90| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 6f 66 20 | | // of |
|00001ea0| 74 68 65 20 77 69 6e 64 | 6f 77 2e 0d 20 20 20 69 |the wind|ow.. i|
|00001eb0| 66 20 28 20 77 69 6e 20 | 26 26 20 70 61 72 74 4e |f ( win |&& partN|
|00001ec0| 75 6d 20 3d 3d 20 69 6e | 43 6f 6e 74 65 6e 74 20 |um == in|Content |
|00001ed0| 26 26 20 78 57 69 6e 64 | 6f 77 3a 3a 57 69 6e 64 |&& xWind|ow::Wind|
|00001ee0| 6f 77 32 58 57 69 6e 64 | 6f 77 28 77 69 6e 2c 26 |ow2XWind|ow(win,&|
|00001ef0| 78 77 69 6e 29 20 29 20 | 7b 0d 20 20 20 20 20 20 |xwin) ) |{. |
|00001f00| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 54 68 65 | | // The|
|00001f10| 20 6c 61 73 74 20 63 68 | 65 63 6b 20 69 73 20 68 | last ch|eck is h|
|00001f20| 65 72 65 20 62 65 63 61 | 75 73 65 20 49 20 77 61 |ere beca|use I wa|
|00001f30| 6e 74 20 74 6f 20 69 67 | 6e 6f 72 65 20 61 6e 79 |nt to ig|nore any|
|00001f40| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001f50| 20 2f 2f 20 77 69 6e 64 | 6f 77 20 74 68 61 74 20 | // wind|ow that |
|00001f60| 77 61 73 6e 27 74 20 63 | 72 65 61 74 65 64 20 62 |wasn't c|reated b|
|00001f70| 79 20 74 68 69 73 20 70 | 72 6f 67 72 61 6d 2e 0d |y this p|rogram..|
|00001f80| 20 20 20 20 20 20 47 65 | 74 50 6f 72 74 28 73 61 | Ge|tPort(sa|
|00001f90| 76 65 50 6f 72 74 29 3b | 0d 20 20 20 20 20 20 53 |vePort);|. S|
|00001fa0| 65 74 50 6f 72 74 28 77 | 69 6e 29 3b 0d 20 20 20 |etPort(w|in);. |
|00001fb0| 20 20 20 47 6c 6f 62 61 | 6c 54 6f 4c 6f 63 61 6c | Globa|lToLocal|
|00001fc0| 28 26 70 74 29 3b 20 20 | 2f 2f 20 46 69 6e 64 43 |(&pt); |// FindC|
|00001fd0| 6f 6e 74 72 6f 6c 20 72 | 65 71 75 69 72 65 73 20 |ontrol r|equires |
|00001fe0| 61 20 70 6f 69 6e 74 20 | 69 6e 20 77 69 6e 64 6f |a point |in windo|
|00001ff0| 77 20 63 6f 6f 72 64 73 | 0d 20 20 20 20 20 20 53 |w coords|. S|
|00002000| 65 74 50 6f 72 74 28 73 | 61 76 65 50 6f 72 74 29 |etPort(s|avePort)|
|00002010| 3b 0d 20 20 20 20 20 20 | 46 69 6e 64 43 6f 6e 74 |;. |FindCont|
|00002020| 72 6f 6c 28 70 74 2c 77 | 69 6e 2c 26 74 68 65 43 |rol(pt,w|in,&theC|
|00002030| 6f 6e 74 72 6f 6c 29 3b | 0d 20 20 20 20 20 20 20 |ontrol);|. |
|00002040| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 69 66 20 74 | | // if t|
|00002050| 68 65 20 6d 6f 75 73 65 | 20 69 73 20 6f 76 65 72 |he mouse| is over|
|00002060| 20 61 20 63 6f 6e 74 72 | 6f 6c 2c 20 46 69 6e 64 | a contr|ol, Find|
|00002070| 43 6f 6e 74 72 6f 6c 20 | 73 65 74 73 0d 20 20 20 |Control |sets. |
|00002080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2f 20 | | // |
|00002090| 74 68 65 43 6f 6e 74 72 | 6f 6c 20 74 6f 20 62 65 |theContr|ol to be|
|000020a0| 20 61 20 68 61 6e 64 6c | 65 20 74 6f 20 74 68 61 | a handl|e to tha|
|000020b0| 74 20 63 6f 6e 74 72 6f | 6c 2c 20 68 65 6e 63 65 |t contro|l, hence|
|000020c0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000020d0| 20 2f 2f 20 6e 6f 6e 2d | 7a 65 72 6f 2e 20 20 49 | // non-|zero. I|
|000020e0| 20 61 6c 73 6f 20 63 68 | 65 63 6b 20 74 68 61 74 | also ch|eck that|
|000020f0| 20 66 69 6e 67 65 72 43 | 75 72 73 6f 72 20 69 73 | fingerC|ursor is|
|00002100| 20 6e 6f 6e 2d 7a 65 72 | 6f 3b 0d 20 20 20 20 20 | non-zer|o;. |
|00002110| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 49 74 | | // It|
|00002120| 20 77 6f 75 6c 64 20 62 | 65 20 7a 65 72 6f 20 69 | would b|e zero i|
|00002130| 66 20 66 6f 72 20 73 6f | 6d 65 20 72 65 61 73 6f |f for so|me reaso|
|00002140| 6e 20 74 68 65 20 63 75 | 72 73 6f 72 20 63 6f 75 |n the cu|rsor cou|
|00002150| 6c 64 6e 27 74 0d 20 20 | 20 20 20 20 20 20 20 20 |ldn't. | |
|00002160| 20 20 20 20 20 20 2f 2f | 20 6c 6f 61 64 65 64 20 | //| loaded |
|00002170| 66 72 6f 6d 20 74 68 65 | 20 72 65 73 6f 75 72 63 |from the| resourc|
|00002180| 65 20 66 69 6c 65 2e 0d | 20 20 20 20 20 20 53 65 |e file..| Se|
|00002190| 74 43 75 72 73 6f 72 28 | 20 28 74 68 65 43 6f 6e |tCursor(| (theCon|
|000021a0| 74 72 6f 6c 20 26 26 20 | 66 69 6e 67 65 72 43 75 |trol && |fingerCu|
|000021b0| 72 73 6f 72 29 20 3f 20 | 2a 66 69 6e 67 65 72 43 |rsor) ? |*fingerC|
|000021c0| 75 72 73 6f 72 20 3a 20 | 26 61 72 72 6f 77 20 29 |ursor : |&arrow )|
|000021d0| 3b 0d 20 20 20 7d 0d 20 | 20 20 65 6c 73 65 0d 20 |;. }. | else. |
|000021e0| 20 20 20 20 20 53 65 74 | 43 75 72 73 6f 72 28 26 | Set|Cursor(&|
|000021f0| 61 72 72 6f 77 29 3b 20 | 20 2f 2f 20 4d 61 6b 65 |arrow); | // Make|
|00002200| 20 73 75 72 65 20 74 6f | 20 73 65 74 20 74 68 65 | sure to| set the|
|00002210| 20 63 75 72 73 6f 72 20 | 74 6f 20 73 6f 6d 65 74 | cursor |to somet|
|00002220| 68 69 6e 67 20 6f 72 0d | 20 20 20 20 20 20 20 20 |hing or.| |
|00002230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002240| 20 20 2f 2f 20 6f 74 68 | 65 72 20 69 6e 20 74 68 | // oth|er in th|
|00002250| 69 73 20 66 75 6e 63 74 | 69 6f 6e 2e 20 20 28 49 |is funct|ion. (I|
|00002260| 74 20 69 73 20 65 61 73 | 69 65 72 20 74 6f 0d 20 |t is eas|ier to. |
|00002270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002280| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 74 68 69 6e | | // thin|
|00002290| 6b 20 69 6e 20 74 65 72 | 6d 73 20 6f 66 20 63 6f |k in ter|ms of co|
|000022a0| 6e 74 69 6e 75 61 6c 6c | 79 20 22 73 65 74 74 69 |ntinuall|y "setti|
|000022b0| 6e 67 22 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ng". | |
|000022c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f | | //|
|000022d0| 20 74 68 65 20 63 75 72 | 73 6f 72 2c 20 72 61 74 | the cur|sor, rat|
|000022e0| 68 65 72 20 74 68 61 6e | 20 74 72 79 69 6e 67 20 |her than| trying |
|000022f0| 74 6f 20 22 63 68 61 6e | 67 65 22 0d 20 20 20 20 |to "chan|ge". |
|00002300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002310| 20 20 20 20 20 20 2f 2f | 20 69 74 20 6f 6e 6c 79 | //| it only|
|00002320| 20 77 68 65 6e 20 6e 65 | 63 65 73 73 61 72 79 2e | when ne|cessary.|
|00002330| 29 0d 7d 0d 0d 76 6f 69 | 64 20 43 6c 65 61 6e 55 |).}..voi|d CleanU|
|00002340| 70 41 70 70 6c 69 63 61 | 74 69 6f 6e 28 76 6f 69 |pApplica|tion(voi|
|00002350| 64 29 20 7b 0d 7d 0d 0d | 0d 2f 2f 20 53 65 74 20 |d) {.}..|.// Set |
|00002360| 75 70 20 74 68 65 20 41 | 62 6f 75 74 20 42 6f 78 |up the A|bout Box|
|00002370| 20 74 6f 20 64 65 73 63 | 72 69 62 65 20 74 68 69 | to desc|ribe thi|
|00002380| 73 20 70 72 6f 67 72 61 | 6d 0d 76 6f 69 64 20 41 |s progra|m.void A|
|00002390| 62 6f 75 74 42 6f 78 28 | 76 6f 69 64 29 20 7b 20 |boutBox(|void) { |
|000023a0| 20 0d 20 20 20 50 61 72 | 61 6d 54 65 78 74 28 20 | . Par|amText( |
|000023b0| 22 5c 70 53 63 72 6f 6c | 6c 20 44 65 6d 6f 22 2c |"\pScrol|l Demo",|
|000023c0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 22 |. | "|
|000023d0| 5c 70 44 61 76 69 64 20 | 45 63 6b 22 2c 0d 20 20 |\pDavid |Eck",. |
|000023e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 22 5c 70 48 | | "\pH|
|000023f0| 6f 62 61 72 74 20 61 6e | 64 20 57 69 6c 6c 69 61 |obart an|d Willia|
|00002400| 6d 20 53 6d 69 74 68 20 | 43 6f 6c 6c 65 67 65 5c |m Smith |College\|
|00002410| 72 47 65 6e 65 76 61 2c | 20 4e 59 20 20 31 34 34 |rGeneva,| NY 144|
|00002420| 35 36 5c 72 45 2d 6d 61 | 69 6c 3a 20 65 63 6b 40 |56\rE-ma|il: eck@|
|00002430| 68 77 73 2e 62 69 74 6e | 65 74 22 2c 0d 20 20 20 |hws.bitn|et",. |
|00002440| 20 20 20 20 20 20 20 20 | 20 20 20 22 5c 70 44 65 | | "\pDe|
|00002450| 6d 6f 6e 73 74 72 61 74 | 65 73 20 74 68 65 20 75 |monstrat|es the u|
|00002460| 73 65 20 6f 66 20 73 63 | 72 6f 6c 6c 20 62 61 72 |se of sc|roll bar|
|00002470| 73 20 69 6e 20 61 6e 20 | 61 70 70 6c 69 63 61 74 |s in an |applicat|
|00002480| 69 6f 6e 20 77 72 69 74 | 74 65 6e 20 75 73 69 6e |ion writ|ten usin|
|00002490| 67 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 20 |g the Ma|cintosh |
|000024a0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 73 68 65 6c |applicat|ion shel|
|000024b0| 6c 20 4d 61 63 53 74 61 | 72 74 65 72 2e 22 29 3b |l MacSta|rter.");|
|000024c0| 0d 20 20 20 41 6c 65 72 | 74 28 31 32 38 2c 30 4c |. Aler|t(128,0L|
|000024d0| 29 3b 0d 7d 0d 0d 76 6f | 69 64 20 44 6f 4e 65 77 |);.}..vo|id DoNew|
|000024e0| 43 6f 6d 6d 61 6e 64 28 | 76 6f 69 64 29 20 7b 0d |Command(|void) {.|
|000024f0| 20 20 20 6d 79 57 69 6e | 64 6f 77 20 2a 77 69 6e | myWin|dow *win|
|00002500| 3b 0d 20 20 20 77 69 6e | 20 3d 20 6e 65 77 20 6d |;. win| = new m|
|00002510| 79 57 69 6e 64 6f 77 3b | 0d 20 20 20 77 69 6e 2d |yWindow;|. win-|
|00002520| 3e 4f 70 65 6e 28 22 5c | 70 53 61 6d 70 6c 65 20 |>Open("\|pSample |
|00002530| 57 69 6e 64 6f 77 22 29 | 3b 0d 7d 00 00 00 00 00 |Window")|;.}.....|
|00002540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002580| 00 00 01 00 00 00 02 ec | 00 00 01 ec 00 00 00 32 |........|.......2|
|00002590| 77 3a 3a 57 69 6e 64 6f | 77 32 58 57 69 6e 64 6f |w::Windo|w2XWindo|
|000025a0| 77 28 28 57 69 6e 64 6f | 77 50 74 72 29 67 45 76 |w((Windo|wPtr)gEv|
|000025b0| 0c 73 63 72 6f 6c 6c 44 | 65 6d 6f 2e 63 b7 02 00 |.scrollD|emo.c...|
|000025c0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000025d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 a9 80 1b 72 00 00 | 00 00 00 00 03 1e 20 20 |.....r..|...... |
|00002600| 20 7d 0d 20 20 20 20 20 | 20 20 20 20 20 63 61 73 | }. | cas|
|00002610| 65 20 61 63 74 69 76 61 | 74 65 45 76 74 3a 20 7b |e activa|teEvt: {|
|00002620| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 |. | if|
|00002630| 20 28 78 57 69 6e 64 6f | 77 3a 3a 57 69 6e 64 6f | (xWindo|w::Windo|
|00002640| 77 32 58 57 69 6e 64 6f | 77 28 28 57 69 6e 64 6f |w2XWindo|w((Windo|
|00002650| 77 50 74 72 29 67 45 76 | 65 6e 74 2e 6d 65 73 73 |wPtr)gEv|ent.mess|
|00002660| 61 67 65 2c 26 77 69 6e | 29 29 0d 20 20 20 20 20 |age,&win|)). |
|00002670| 20 20 20 20 20 20 20 20 | 20 20 20 77 69 6e 2d 3e | | win->|
|00002680| 00 00 01 e8 00 13 00 00 | 23 0f 00 00 23 17 09 41 |........|#...#..A|
|00002690| 62 6f 75 74 42 6f 78 00 | 00 00 19 73 00 00 19 82 |boutBox.|...s....|
|000026a0| 0f 41 70 70 6c 69 63 61 | 74 69 6f 6e 49 64 6c 65 |.Applica|tionIdle|
|000026b0| 00 00 22 ba 00 00 22 cc | 13 43 6c 65 61 6e 55 70 |.."...".|.CleanUp|
|000026c0| 41 70 70 6c 69 63 61 74 | 69 6f 6e 00 00 00 15 af |Applicat|ion.....|
|000026d0| 00 00 15 b9 0b 44 6f 45 | 64 69 74 4d 65 6e 75 00 |.....DoE|ditMenu.|
|000026e0| 00 00 15 d1 00 00 15 db | 0b 44 6f 46 69 6c 65 4d |........|.DoFileM|
|000026f0| 65 6e 75 00 00 00 24 5b | 00 00 24 67 0d 44 6f 4e |enu...$[|..$g.DoN|
|00002700| 65 77 43 6f 6d 6d 61 6e | 64 00 00 00 16 c2 00 00 |ewComman|d.......|
|00002710| 16 cd 0b 44 6f 4f 74 68 | 65 72 4d 65 6e 75 00 00 |...DoOth|erMenu..|
|00002720| 11 d9 00 00 11 e8 0f 49 | 6e 69 74 41 70 70 6c 69 |.......I|nitAppli|
|00002730| 63 61 74 69 6f 6e 00 00 | 0e 2f 00 00 0e 48 19 6d |cation..|./...H.m|
|00002740| 79 57 69 6e 64 6f 77 3a | 3a 61 64 6a 75 73 74 54 |yWindow:|:adjustT|
|00002750| 6f 4e 65 77 53 69 7a 65 | 00 00 09 1f 00 00 09 2e |oNewSize|........|
|00002760| 0f 6d 79 57 69 6e 64 6f | 77 3a 3a 43 6c 6f 73 65 |.myWindo|w::Close|
|00002770| 00 00 11 8c 00 00 11 a0 | 15 6d 79 57 69 6e 64 6f |........|.myWindo|
|00002780| 77 3a 3a 64 6f 41 63 74 | 69 76 61 74 65 00 00 00 |w::doAct|ivate...|
|00002790| 09 79 00 00 09 91 19 6d | 79 57 69 6e 64 6f 77 3a |.y.....m|yWindow:|
|000027a0| 3a 64 6f 43 6f 6e 74 65 | 6e 74 43 6c 69 63 6b 00 |:doConte|ntClick.|
|000027b0| 00 00 11 06 00 00 11 19 | 13 6d 79 57 69 6e 64 6f |........|.myWindo|
|000027c0| 77 3a 3a 64 6f 48 53 63 | 72 6f 6c 6c 00 00 09 56 |w::doHSc|roll...V|
|000027d0| 00 00 09 65 0f 6d 79 57 | 69 6e 64 6f 77 3a 3a 64 |...e.myW|indow::d|
|000027e0| 6f 4b 65 79 00 00 0b 52 | 00 00 0b 64 13 6d 79 57 |oKey...R|...d.myW|
|000027f0| 69 6e 64 6f 77 3a 3a 64 | 6f 52 65 64 72 61 77 00 |indow::d|oRedraw.|
|00002800| 00 00 11 49 00 00 11 5c | 13 6d 79 57 69 6e 64 6f |...I...\|.myWindo|
|00002810| 77 3a 3a 64 6f 56 53 63 | 72 6f 6c 6c 00 00 08 90 |w::doVSc|roll....|
|00002820| 00 00 08 a4 15 6d 79 57 | 69 6e 64 6f 77 3a 3a 4f |.....myW|indow::O|
|00002830| 70 65 6e 49 6e 52 65 63 | 74 00 00 00 07 43 00 00 |penInRec|t....C..|
|00002840| 07 58 15 6d 79 57 69 6e | 64 6f 77 3a 3a 53 65 74 |.X.myWin|dow::Set|
|00002850| 44 65 66 61 75 6c 74 73 | 00 00 13 c7 00 00 13 d2 |Defaults|........|
|00002860| 0b 55 70 64 61 74 65 4d | 65 6e 75 73 00 00 01 00 |.UpdateM|enus....|
|00002870| 00 00 02 ec 00 00 01 ec | 00 00 00 32 00 68 ac 9c |........|...2.h..|
|00002880| 05 26 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.&.....2|..MPSR..|
|00002890| 00 0a 03 ef ff ff 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+